package com.cy.pj.sys.controller;

import com.cy.pj.common.bo.PageObject;
import com.cy.pj.common.pojo.JsonResult;
import com.cy.pj.common.pojo.SysLog;
import com.cy.pj.sys.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Cx
 * @stage secondStageOfWeb
 * @creat 2020-11-14 14:36
 */
@Controller
@RequestMapping("/log/")
public class SysLogController {

    @Autowired
    private SysLogService sysLogService;

    @RequestMapping("doFindPageObjects")
    @ResponseBody
    public JsonResult doFindPageObjects(String username, Integer pageCurrent) {
        PageObject<SysLog> pageObject = sysLogService.findPageObjects(username, pageCurrent);
        return new JsonResult(pageObject);
    }

    @RequestMapping("doDeleteObjects")
    @ResponseBody /* 添加用于执行删除业务的方法 */
    public JsonResult doDeleteObjects(Integer... ids) {
        sysLogService.deleteObjects(ids);
        return new JsonResult("delete ok");
    }

}
